django filter not equal to

42

django filter not equal to -

from myapp.models import Entry
from django.db.models import Q
# Returns all entries except those with 3 as their id
Entry.objects.filter(~Q(id=3))

Comments

Submit
0 Comments